package com.zy.baselib.tools;

import androidx.annotation.NonNull;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @author: shalei
 * @since: 2020-01-16 13:20
 * @Desc:
 **/
public class MatchUtil {

    private static final String regex = "^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(17[013678])|(16[0-9])|(18[0,5-9])|(19[0-9]))\\d{8}$";

    public static boolean checkPhone(@NonNull String phone) {
        Pattern p = Pattern.compile(regex);
        Matcher m = p.matcher(phone);
        return m.matches();
    }
}
